<?php
/**
 * 测试curl提交数据
 */

$newData = array( 'vb_login_username' => 'kldoo',
		'vb_login_password' => 'kld123',
		'submit' => '登录论坛',
		'cookieuser' => '1');

$curlPost = '';
foreach ($newData as $key => $value) {
	$curlPost .= $key.'='.urlencode($value).'&';
}


$ch = curl_init();
$dArr = array( 
	CURLOPT_URL => 'http://www.linuxsir.org/bbs/index.php',
	CURLOPT_HEADER =>  1,
	CURLOPT_RETURNTRANSFER => 1,
	CURLOPT_POST => 1,
	CURLOPT_POSTFIELDS => $curlPost,
	CURLOPT_COOKIEJAR => tempnam('./', 'cookie')
);
curl_setopt_array($ch, $dArr);
$data = curl_exec($ch);
curl_close($ch);

var_dump(  "!-- {$data} --"  );
?>